{if $is_tpl == 'index'}
    <link type="text/css" rel="stylesheet" href="{Common::get_mobile_domain()}/public/css/lanmustyle.css">
{elseif $is_tpl == 'list'}
    <link type="text/css" rel="stylesheet" href="{Common::get_mobile_domain()}/public/css/list.css">
{else}
    <link type="text/css" rel="stylesheet" href="{Common::get_mobile_domain()}/public/css/details.css">
{/if}

<script type="text/javascript" src="{Common::get_mobile_domain()}/public/js/lanmu.js"></script>
<script type="text/javascript" src="{Common::get_mobile_domain()}/public/js/common.js"></script>
<script type="text/javascript" src="{Common::get_mobile_domain()}/public/js/login.js"></script>


<div class="box_dev">
<div id="header-nav">
    <div class="header-nav__title">
        <div class="header-nav__left">
            {if $is_tpl == 'index'}
                <a href="{$cmsurl}" data-ajax="false"></a>
                <a href="{$cmsurl}search" data-ajax="false"></a>
            {elseif $is_tpl == 'list'}
                <a href="javascript:history.back(-1);"></a>
                <a href="{$cmsurl}" data-ajax="false"></a>
                <a href="{$cmsurl}search" data-ajax="false"></a>
            {else}
                <a href="javascript:history.back(-1);"></a>
                <a href="{$cmsurl}" data-ajax="false"></a>
            {/if}
        </div>
        <div class="header-nav__right">
            <a href="{$cmsurl}member" data-ajax="false">我的</a>
            <a class="nav-js--block" href="javascript:void(0)">导航</a>
        </div>
        <h1>{$channelname}</h1>
    </div>

    <div class="header-nav__con">
        <ul class="clearfix">
            {st:channel action="getchannel" row="100"}
            {loop $data $row}
            <li>
                <a href="{$row['url']}" data-ajax="false">
                    <div class="header-nav__con__img"><img src="{$row['ico']}" alt="{$row['title']}"></div>
                    <p class="header-nav__con__p">{$row['title']}</p>
                </a>
            </li>
            {/loop}
            {/st}
        </ul>
    </div>
</div>
</div>
<div class="nav-shadow"></div>


<script type="text/javascript">
    var SITEURL = "{$cmsurl}";
    //过滤非法字符
    function StripScript(s){
        var pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~！@#￥……&*（）――|{}【】‘；：”“'。，、？]");
        var rs = "";
        for (var i = 0; i < s.length; i++) {
            rs = rs+s.substr(i, 1).replace(pattern, '');
        }
        return rs;
    }
    //全局搜索s
    $('.search-btn').click(function () {
        var keyword = StripScript($.trim($("#myinput").val()));
        if (keyword == '') {
            keyword = $('#myinput').attr('placeholder');
            if(keyword == '')
            {
                layer.open({
                    content: '{__("error_keyword_not_empty")}',
                    btn: ['{__("OK")}']
                });
                return false;
            }
        }
        url = SITEURL +'search?keyword='+encodeURIComponent(keyword);

        window.location.href = url;
    });
    $(function(){
        //头部下拉导航
        $(".st-user-menu").on("click",function(){
            $(".header-menu-bg,.st-down-bar").show();
            $("html,body").css({overflow:"hidden"})
        });
        $(".header-menu-bg").on("click",function(){
            $(".header-menu-bg,.st-down-bar").hide();
            $("html,body").css({overflow:"auto"})
        });
        //登录检测
        ST.Login.check_login();
        //$('body').append('<script'+' type="text/javascript" src="'+SITEURL+'member/login/ajax_islogin"></'+'script>');
    });

    function is_login($obj){
        var fx_url="content={urlencode($info['title'])}";
        if($obj['islogin']==1){
            if($obj['info']['fx_member']){
                if(window.location.href.indexOf('/show_')!=-1)
                {
                    var btn = $($obj['info']['fx_btn'].replace('[fx_url]', fx_url));
                    $('.bom_fixed a').eq(0).after(btn);
                    btn.attr('data-ajax',false);
                    btn.addClass('now-sell');
                    //增加分销图标
                    $obj['info']['fx_btn']=$obj['info']['fx_btn'].replace(/<a.*?\/a>/,'<a href="javascript:;" class="item fx" id="share_btn"><i class="icon"></i>我要分销</a>');
                    btn = $($obj['info']['fx_btn'].replace('[fx_url]', fx_url));
                    $('.fixed-container-bar a').eq(0).after(btn);
                }
            }
        }
    }
	
	(function() {
		
		// 判断是否微信浏览器
		function isWeiXin(){
		    var ua = window.navigator.userAgent.toLowerCase();
		    if(ua.match(/MicroMessenger/i) == 'micromessenger'){
		        return true;
		    }else{
		        return false;
		    }
		}
		
		function handleFontSize() {
		    // 设置网页字体为默认大小
		    WeixinJSBridge.invoke('setFontSizeCallback', { 'fontSize' : '12px' });
		    // 重写设置网页字体大小的事件
		    WeixinJSBridge.on('menu:setfont', function() {
		        WeixinJSBridge.invoke('setFontSizeCallback', { 'fontSize' : '12px' });
		    });
		}
		
		if(isWeiXin){
			if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
			    handleFontSize();
			} else {
			    if (document.addEventListener) {
			        document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
			    } else if (document.attachEvent) {
			        document.attachEvent("WeixinJSBridgeReady", handleFontSize);
			        document.attachEvent("onWeixinJSBridgeReady", handleFontSize);  }
			}
		}
	    
	})();
	
</script>

{include 'pub/share'}